using GGameFramework.Runtime;
using UnityEngine;

namespace BangBangHell
{
    public partial class GameEntry
    {
        /// <summary>
        /// 状态机
        /// </summary>
        public static FsmComponent Fsm { get; private set; }
        
        /// <summary>
        /// 事件组件
        /// </summary>
        public static EventComponent Event { get; private set; }

        /// <summary>
        /// 对象池组件
        /// </summary>
        public static PoolComponent Pool { get; private set; }

        /// <summary>
        /// 计时器组件
        /// </summary>
        public static TimerComponent Timer { get; private set; }
        
        /// <summary>
        /// 计时器组件
        /// </summary>
        public static AudioComponent Audio { get; private set; }

        private static void InitBuiltinComponents()
        {
            Debug.Log("获取GameEntry组件");
            Fsm = GGameFramework.Runtime.ComponentEntry.GetSystem<FsmComponent>();
            Event = GGameFramework.Runtime.ComponentEntry.GetSystem<EventComponent>();
            Pool = GGameFramework.Runtime.ComponentEntry.GetSystem<PoolComponent>();
            Timer = GGameFramework.Runtime.ComponentEntry.GetSystem<TimerComponent>();
            Audio = GGameFramework.Runtime.ComponentEntry.GetSystem<AudioComponent>();
        }
    }
}